package com.neusoft.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.po.CommonResult;
import com.neusoft.po.Food;
import com.neusoft.service.FoodService;

@RefreshScope
@RestController
@RequestMapping("/FoodController")
public class FoodController {
	@Autowired
	FoodService foodService;
	
	@PostMapping("/listFoodByBusinessId/{businessId}")
	public CommonResult<List<Food>> listFoodByBusinessId(@PathVariable("businessId") int businessId){
		return new CommonResult<List<Food>>(200,"success",foodService.listFoodByBusinessId(businessId));
	}
}
